
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-18
**/
@Entity
@Data
@Table(name="app_doc")
public class AppDoc implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "doc_id")
    @ApiModelProperty(value = "ID")
    private Integer docId;

    @Column(name = "area_id")
    @ApiModelProperty(value = "责任区ID")
    private Integer areaId;

    @Column(name = "title")
    @ApiModelProperty(value = "名称")
    private String title;

    @Column(name = "type")
    @ApiModelProperty(value = "废弃：1政策文件，2知识文档")
    private Integer type;

    @Column(name = "cate_id")
    @ApiModelProperty(value = "分类ID")
    private Integer cateId;

    @Column(name = "type2")
    @ApiModelProperty(value = "1图片，2文档，3其它")
    private Integer type2;

    @Column(name = "icon")
    @ApiModelProperty(value = "图标")
    private String icon;

    @Column(name = "url")
    @ApiModelProperty(value = "下载路径")
    private String url;

    @Column(name = "click")
    @ApiModelProperty(value = "浏览量")
    private Integer click;

    @Column(name = "ordid")
    @ApiModelProperty(value = "排序，越小越靠前")
    private Integer ordid;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "create_time")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    public void copy(AppDoc source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}